<!-- login box on signup page widget -->
<?php if (!Am_Di::getInstance()->auth->getUserId()) : ?>
<div class="am-login-text"><?php __e("If you already have an account on our website, please %slogin%s to continue",
        '<a href="javascript:" id="show-login-box-on-signup">', '</a>') ?></div>
<div class="am-signup-login-form-container" style="display:none">
    <div style="font-size: xx-small; text-align: right; width: 100%;">
        <a href="javascript:" id="hide-login-box-on-signup">
            <img src="<?php echo $this->_scriptImg('modal-close.png') ?>" alt="<?php __e('Close') ?>" title="<?php __e('Close') ?>"/>
        </a>
    </div>
    <br />
    <div class="am-layout-two-coll">
        <div class="am-layout-two-coll-top"></div>
        <div class="am-coll-left">
            <div class="am-coll-content">

                <div class="am-form am-login-form am-signup-login-form">
                    <form name="login" method="post" action="<?php echo REL_ROOT_URL?>/login">
                        <fieldset>
                            <legend>&nbsp;&nbsp;<?php __e('Member Login') ?></legend>
                            <div class="row">
                                <div class="element-title">
                                    <label class="element-title" for="login"><?php __e('E-Mail Address or Username') ?></label>
                                </div>
                                <div class="element">
                                    <input type="text" id="login" name="amember_login" size="15" value="<?php p(@$_REQUEST['amember_login']) ?>" />
                                </div>
                            </div>
                            <div class="row">
                                <div class="element-title">
                                    <label class="element-title" for="pass"><?php __e('Password') ?></label>
                                </div>
                                <div class="element">
                                    <input type="password" id="pass" name="amember_pass" size="15" />
                                </div>
                            </div>
                            <div class="row">
                                <div class="element-title"></div>
                                <div class="element" style="vertical-align: baseline">
                                    <input type="submit" value="&nbsp;&nbsp;&nbsp;<?php __e('Login') ?>&nbsp;&nbsp;&nbsp;" />
                                </div>
                            </div>
                        </fieldset>
                        <input type="hidden" name="login_attempt_id" value="<?php print time()?>" />
                        <input type="hidden" name="amember_redirect_url" value="<?php p($_SERVER['REQUEST_URI']) ?>" />
                    </form>
                </div>
            </div>
        </div>
        <div class="am-coll-right">
            <div class="am-coll-content">
                <div class="am-form am-sendpass-form">
                    <form name="sendpass" method="post" action="<?php echo REL_ROOT_URL ?>/sendpass">
                        <fieldset>
                            <legend>&nbsp;&nbsp;<?php __e('Lost password') ?></legend>
                            <div class="row">
                                <div class="element-title">
                                    <label class="element-title" for="sendpass"><?php __e('Enter your <b>E-Mail Address</b> or <b>Username</b>') ?></label>
                                </div>
                                <div class="element"><input type="text" name="login" id="sendpass" size="15" /></div>
                            </div>
                            <div class="row">
                                <div class="element-title"></div>
                                <div class="element">
                                    <input type="submit" value="<?php __e('Get Password') ?>" />
                                </div>
                            </div>
                        </fieldset>
                    </form>
                </div>
            </div>
        </div>
        <div class="am-layout-two-coll-bottom"></div>
    </div>
</div>

<script type="text/javascript">
    jQuery(document).ready(function($) {
        $("#show-login-box-on-signup").click(function(){
            $("body").append("<div id='mask'></div>");
            $(".am-signup-login-form-container").show(100);
        });
        $("#hide-login-box-on-signup").click(function(){
            $("#mask").remove();
            $(".am-signup-login-form-container").hide(100);
        });
        $(".am-signup-login-form form").amAjaxLoginForm({
            success: function() { window.location.reload(true); }
        });// from user.js
    });
</script>
<?php else: // if logged-in ?>
<div class="am-login-text">
        <?php __e("You are logged-in as %s. %sLogout%s to signup as new user.",
                "<strong>". Am_Di::getInstance()->auth->getUsername() . "</strong>",
                "<a href='".REL_ROOT_URL."/logout?amember_redirect_url=".urlencode($_SERVER['REQUEST_URI'])."'>",
                "</a>"
        ); ?>
</div>
<?php endif // if not logged-in ?>
<!-- login box on signup page widget end -->